package com.hornsun.data.constant.error;

/**
 * Created by 编译中... on 2018/8/2.
 */
public enum AccountError {

    ACCOUNT_OR_PASSWORD_ERROR(10010,"账号或密码错误"),
    VERIFICATION_CODE_ERROR(10011,"验证码错误"),
    TWO_PASSWORD_DIFFERENT(10012,"两次密码不一致"),
    OLD_PASSWORD_ERROR(10013,"旧密码出错"),
    ACCOUNT_FORMAT_ERROR(10014,"账号格式错误"),
    NAME_TOO_LONG(10015,"真实姓名过长"),
    INIT_PASSWORD(10016,"密码初始化"),
    PASSWORD_FORMAT_ERROR(10017,"密码格式错误"),
    NOT_INIT_PASSWORD(10018,"不是初始密码"),
    SAME_WITH_OLD(10019,"与旧密码相同"),
    IS_SUPER(10040,"超级管理员");


    private Integer code;
    private String content;

    AccountError(Integer code , String content){this.code=code;this.content=content;}

    public Integer getCode() {
        return code;
    }

    public String getContent() {
        return content;
    }

    public static AccountError loginErrorByContent(String content) {
        for (AccountError loginError : values()) {
            if (loginError.content.equals(content)){
                return loginError;
            }
        }
        return null;
    }
}
